package cn.bugDance.domain.rebate.service.quota;

import cn.bugDance.domain.rebate.model.entity.UserCalendarQuotaEntity;
import cn.bugDance.domain.rebate.model.entity.UserCalendarSignRecordEntity;
import cn.bugDance.domain.rebate.repository.IRebateRepository;
import cn.bugDance.domain.rebate.service.ICalendarQuotaService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;

@Service
public class CalendarQuotaService implements ICalendarQuotaService {

    @Resource
    private IRebateRepository rebateRepository;

    private final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
    private final SimpleDateFormat monthFormat = new SimpleDateFormat("yyyy-MM");

    @Override
    public UserCalendarQuotaEntity queryUserCalendarQuota(String userId, Long activityId) {
        Date now = new Date();
        String month = monthFormat.format(now);

        List<UserCalendarSignRecordEntity> userCalendarSignRecordEntities = rebateRepository.queryUserCalendarSignRecords(userId, activityId, month);
        UserCalendarQuotaEntity userCalendarQuotaEntity = new UserCalendarQuotaEntity();
        userCalendarQuotaEntity.setUserId(userId);
        return null;
    }
}
